//
// Created by Administrator on 2017/3/19 019.
//

#ifndef TQ_ED_H
#define TQ_ED_H

#include "base.h"
#include "ed_md5header.h"

#include <string.h>
#include <sys/types.h>

# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))

const char *UNSIGNATURE = "ILLEGAL_ACCESS";
#define JNIREG_CLASS "com/white/ndkmaster/NativeX"

/****
 * 未加身份验证码的MD5
 * @return
 */
jstring _md5(JNIEnv *,jobject, jstring);

/***
 * 获取app签名长串，未做任何处理
 * @return
 */
//jstring getSingleSign(JNIEnv *,jobject, jobject);

jstring my_sha1(JNIEnv *env,jobject clazz, jstring);

//jstring my_aesEcbEncrypt(JNIEnv *env,jobject clazz,jobject, jstring);
jstring my_aesEcbEncryptWithKey(JNIEnv *env,jobject clazz,jstring, jstring);
//jstring my_aesEcbDecrypt(JNIEnv *env,jobject clazz,jobject,jstring);
jstring my_aesEcbDecryptWithKey(JNIEnv *env,jobject clazz,jstring, jstring);

jstring my_aesCbcEncrypt(JNIEnv *env,jobject clazz,jstring iv, jstring key, jstring str_);
jstring my_aesCbcDecrypt(JNIEnv *env,jobject clazz,jstring iv, jstring key, jstring str_);

/***
 * 写字符串至文件
 * @param path
 * @param content
 * @return
 */
jint WriteString2File(JNIEnv *env, jobject clazz, jstring path, jstring content);

jstring ReadString(JNIEnv *env, jobject clazz, jstring path);

/***
 * 获取签名加密串
 * @param env
 * @param thiz
 * @param context
 * @return
 */
//jstring getSign(JNIEnv *env, jobject thiz, jobject context);

jbyteArray crypt(JNIEnv *env,jobject clazz, jobject ctx, jbyteArray ar);



#endif //TQ_ED_H

